package com.eastfair.notice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-08-30
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("c_comment")
@ApiModel(value = "Comment", description = "")
@AllArgsConstructor
public class Comment extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会ID")
    private Long exhibitionId;

    /**
     * 父级ID
     */
    @ApiModelProperty(value = "父级ID")
    @TableField(value = "parent_id")
    @Excel(name = "父级ID")
    private Long parentId;

    /**
     * 回复人userId
     */
    @ApiModelProperty(value = "回复人userId")
    @TableField(value = "user_id")
    @Excel(name = "回复人userId")
    private Long userId;

    /**
     * 被回复人userId
     */
    @ApiModelProperty(value = "被回复人userId")
    @TableField(value = "parent_user_id")
    @Excel(name = "被回复人userId")
    private Long parentUserId;

    /**
     * 层级
     */
    @ApiModelProperty(value = "层级")
    @Size(max = 255, message = "层级长度不能超过255")
    @TableField(value = "code", condition = LIKE)
    @Excel(name = "层级")
    private String code;

    /**
     * 所属业务类型
     */
    @ApiModelProperty(value = "所属业务类型")
    @Size(max = 32, message = "所属业务类型长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "所属业务类型")
    private String subjectType;

    /**
     * 所属业务ID
     */
    @ApiModelProperty(value = "所属业务ID")
    @TableField(value = "subject_id")
    @Excel(name = "所属业务ID")
    private Long subjectId;

    /**
     * 回复内容
     */
    @ApiModelProperty(value = "回复内容")
    @Size(max = 65535, message = "回复内容长度不能超过65535")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "回复内容")
    private String content;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;


    @Builder
    public Comment(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, Long parentId, Long userId, Long parentUserId, 
                    String code, String subjectType, Long subjectId, String content, Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.parentId = parentId;
        this.userId = userId;
        this.parentUserId = parentUserId;
        this.code = code;
        this.subjectType = subjectType;
        this.subjectId = subjectId;
        this.content = content;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
